import java.io.IOException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class Main {

    public static void main(String[] args) throws Exception {

        System.out.println("begin");

        // 定义urls
        String[] urls = {
                "https://gczdy.blog.csdn.net/article/details/142264483?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/142147649?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/142136907?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/142067234?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/141785495?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/141611963?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/141061520?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/141018783?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140968922?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140649503?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140614860?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140593361?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140578888?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140508778?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140508640?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140508605?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140506881?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140472339?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140472167?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140451356?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140388910?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140373832?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140373075?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140372878?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140348976?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140348916?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140348866?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140348741?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140348677?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140321761?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140321560?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140321395?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140321249?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140250055?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140208064?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140205821?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140205542?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140191116?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140191038?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140190919?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140077825?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140025185?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140025116?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140025037?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/140024941?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139993658?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139987333?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139962431?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139962247?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139926411?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139920678?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139904327?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139904250?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139858097?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139857996?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139857617?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139842155?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139841808?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139839866?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139827485?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139827065?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139813727?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139801399?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139789512?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139784580?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139763945?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139761161?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139749658?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139748795?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139740778?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139722428?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139721039?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139716477?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139707817?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139707469?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139705934?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139702089?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139701410?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139699078?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139697708?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139649569?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139607881?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139577409?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139575679?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139564507?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139564441?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139564370?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139503667?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139496823?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139482648?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139454479?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139449533?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139449533?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139439966?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139418519?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139411225?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139410787?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139410142?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139409901?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139397540?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139397401?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139333409?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139320354?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139320155?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139303066?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139277124?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139264296?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139264104?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139239424?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139236954?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139236748?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139235089?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139215357?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139203199?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139202333?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139177346?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139176898?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139176563?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139133620?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139113889?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139099433?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139099352?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139093436?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137173464?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139060294?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139044544?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139039655?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139035484?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139035038?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139034921?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/139013325?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138875706?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138796704?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138758226?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138696285?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138686099?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138633518?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138612261?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138609204?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138609029?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138587678?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138546842?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138479359?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138451314?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138452971?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138451005?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138449989?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138449110?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138448073?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138442638?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138423510?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138395591?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138380155?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138378805?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138377646?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138265978?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/138124248?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137978399?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137978015?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137938233?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137838325?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137838207?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137833213?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137817857?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137754472?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137695434?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137654271?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137652105?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137637767?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137637307?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137608945?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137608706?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137568781?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137548424?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137472805?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137438978?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137410056?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137399643?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137383116?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137383049?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137382242?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137358559?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137204070?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137183651?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137155428?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137123207?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137064080?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137063667?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137046427?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137029925?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/137026187?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/136884702?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/136786912?spm=1001.2014.3001.5502",
                "https://gczdy.blog.csdn.net/article/details/136774948?spm=1001.2014.3001.5502"
        };

        // 创建定时执行的线程池
        // 此时有5条线程
        ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);

        // 循环访问多个网址，并每隔20秒执行一次
        for (String url : urls) {
            Runnable task = () -> {
                try {
                    PostRequestSender sender = new PostRequestSender(url);
                    sender.sendPostRequest();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            };
            // 初始延迟10秒，每隔50秒执行一次任务
            executor.scheduleAtFixedRate(task, 0, 50, TimeUnit.SECONDS);
        }

        // 等待所有任务完成后关闭线程池
        executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
        executor.shutdown();
    }
}